chore(python,example): exampleにshebangを付けてexecutableにする#1077
Merged
qryxip merged 4 commits intoMay 1, 2025
Merged
Conversation
Member
Author
error: could not compile `proc-macro2` (lib) due to 3 previous errors |
Hiroshiba
reviewed
Apr 26, 2025
Member
Author
|
個人的には一般的な気がしています。Bashと同じような感覚。ONNX Runtimeなんかでも結構あったはず。 逆に付けないことによるデメリットとして、MSYS環境(e.g. Git Bash)にてシェルスクリプトとして実行されうるというのもあるはずかなと。 ❯ echo 'print("hi")' > ./a.py
❯ # MSYSだと、Git側のfilemodeに関わらずそのまま実行可能になってしまう
❯ ./a.py
./a.py: line 1: syntax error near unexpected token `"hi"'
./a.py: line 1: `print("hi")' |
Member
Author
|
|
9c859b1 to
1e4316c
Compare
1e4316c to
a2e2f3d
Compare
Member
|
うーーーん! あとシバンつけることに対してちょっとセカンドオピニオンが欲しい。 |
This reverts commit a2e2f3d.
Member
Author
|
あ、そっか |
Member
Author
|
あ、いやcmdやPowerShellだったら |
sevenc-nanashi
approved these changes
May 1, 2025
Member
sevenc-nanashi
left a comment
There was a problem hiding this comment.
shebang追加だけなら大丈夫だと思います。
Hiroshiba
approved these changes
May 1, 2025
qryxip
added a commit
that referenced
this pull request
May 4, 2025
#1077 の続き。 このリポジトリ内のすべてのファイルに対し、以下のチェックを義務付ける。 ```bash if has_shebang && ! is_executable; then echo 'A shebanged file must be executable (note: if you are using Windows, please change the filemode with `git update-index --chmod+x`)' exit 1 fi if is_shellscript && ! is_executable; then echo 'A shell script file must be executable (note: if you are using Windows, please change the filemode with `git update-index --chmod+x`)' exit 1 fi if is_executable && ! has_shebang; then echo 'An executable blob must have a shebang' exit 1 fi ```
Member
Author
|
|
3 tasks
Member
Author
|
いや、Python exampleは |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
run{,-asyncio}.pyにshebangを付け、filemodeも
100755(GIT_FILEMODE_BLOB_EXECUTABLE)にする。shebangを
python3ではなくpythonにしているのは、仮想環境を前提にしたいから。関連 Issue
その他